// - post /login {username:'admin',password:'admin'}
// - 颁发token 
//     之前 种下session 自动种下cookie 传统 缺点
const Koa = require('koa');
const app = new Koa();
const router = require('koa-router')();
// 解析请求体 等待post请求体全部到达
const bodyParser = require('koa-bodyparser')
const cors = require('koa-cors')
const authRouter = require('./routers/auth')
const testRouter = require('./routers/test')

app.use(cors());
app.use(bodyParser());
router.use('/api/auth',authRouter);
router.use('/api/test',testRouter);
app.use(router.routes());
app.listen(1314);